<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
      xmlns:a4j="http://richfaces.org/a4j"
      xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="/layouts/CrudPesquisar.xhtml">
	<ui:param name="bean" value="#{ManageOrientacao}" />

	<ui:define name="breadcrumb_content">
		<h:outputLink value="#" title="Listagem de Orientações de Alunos" styleClass="active">Listagem de Orientações de Alunos</h:outputLink>
	</ui:define>
		
	<ui:define name="quick_links">
	</ui:define>
			
	<ui:define name="OUTRAS_ACOES">
	</ui:define>

<ui:define name="COLUNA_ACOES">
							<h:column headerClass="colunaAcoes">									
								<f:facet name="header">
                                    <h:outputText value="Excluir"/>
                                </f:facet>
                                <h:panelGroup rendered="#{!item.instrumentoConclusao.finalizado}">
									<h:commandLink action="#{bean.exibirExclusao}"  title="Excluir" immediate="true">
										<h:graphicImage value="/images/excluir.png" />
										<f:setPropertyActionListener value="#{item}" target="#{bean.dadosForm}"/>					
									</h:commandLink>
								</h:panelGroup>
							</h:column>

	                        <ui:insert name="COLUNA_ACOES_DIREITA">
	                        </ui:insert>
</ui:define>

	<ui:define name="PESQUISA">
			<h:form id="formPesquisar">
				<fieldset id="dadosPesquisa">
					<div class="legenda"><span></span></div>
					<ul>
						<li> 
							<h:outputLabel value="Instrumento de Conclusão: " for="nome" />
							<h:selectOneMenu  value="#{bean.instrumentoConclusaoSelecionado}" converter="SimpleIndexConverter">
								<f:selectItem itemLabel="Selecione um Item" itemValue="#{null}"/>
								<t:selectItems value="#{bean.todosInstrumentosConclusao}" 
										itemLabel="#{item.aluno.nome} - #{item.titulo}" itemValue="#{item}" var="item" />
							</h:selectOneMenu>
						</li>
						<li>
							<h:commandButton action="#{bean.filtrar}" value="Buscar Orientações" styleClass="btForm" />
						</li>
					</ul>
				</fieldset>
			</h:form>
	</ui:define>
	
	<ui:define name="COLUNAS">
	
		<h:column>
			<f:facet name="header">
				<h:outputText value="Data" />
			</f:facet>
			<h:outputText value="#{item.dataCriacao}" >
					<f:convertDateTime pattern="dd/MM/yyyy"/>
			</h:outputText>  
		</h:column>
		<h:column>
			<f:facet name="header">
				<h:outputText value="Aluno Orientado" />
			</f:facet>
			<h:outputText value="#{item.instrumentoConclusao.aluno.nome}" />
		</h:column>
		<h:column>
			<f:facet name="header">
				<h:outputText value="Título" />
			</f:facet>
			<h:outputText value="#{item.titulo}" />
		</h:column>
		<h:column>
			<f:facet name="header">
				<h:outputText value="mensagem" />
			</f:facet>
			<h:outputText value="#{item.mensagem}" />
		</h:column>
	</ui:define>
	
	<ui:define name="COLUNA_ACOES_DIREITA">
	</ui:define>	
	</ui:composition>

</html>
